package com.ctshk.rpc.order.airexpress.service;

import com.ctshk.common.dto.Result;
import com.ctshk.common.model.PageResponse;
import com.ctshk.common.model.TokenUser;
import com.ctshk.common.vo.OrderRefundDTO;
import com.ctshk.rpc.order.airexpress.dto.*;
import com.ctshk.rpc.order.airexpress.req.*;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 机场快线订单表 服务类
 * </p>
 *
 * @author 叶冠峰
 * @since 2021-02-23
 */
public interface IAirportExpressOrderService {

    Result submit(AirportExpressOrderReq airportExpressOrderReq, Long userId);

    Result payment(Long id, List<AirportExpressOrderCollectionReq> airportExpressOrderCollectionReqList, Long userId) throws Exception;

    Result mtrTest(int type, String s);

    Result<AirportExpressOrderQueryDTO> query(Long id);

    PageResponse<AirportExpressOrderPageDTO> list(AirportExpressOrderListReq airportExpressOrderListReq);

    /**
     * 申请取消订单退款
     *
     * @param id
     * @param airportExpressOrderCancelReq
     * @param currentUser
     * @return
     */
    Result cancel(Long id, AirportExpressOrderCancelReq airportExpressOrderCancelReq, TokenUser currentUser);

    /**
     * 更新联系人
     *
     * @param airportExpressOrderTouristUpdateReq
     * @param userId
     * @return
     */
    int updateContact(AirportExpressOrderUpdateReq airportExpressOrderTouristUpdateReq, Long userId);

    /**
     * 确认退款
     *
     * @param id
     * @param refundId
     * @param userId
     * @return
     */
    Result<Long> confirmRefund(Long id, Long refundId, Long userId);

    /**
     * 支付页面查询信息
     *
     * @param id
     * @return
     */
    Result<AirportExpressOrderPayInfoDTO> paymentInfoById(Long id);

    /**
     * 获取退款金额
     *
     * @param id
     * @return
     */
    BigDecimal getRefundAmount(Long id);

    /**
     * 获取退款记录列表(财务-内部接口)
     *
     * @param orderNumber 订单编号
     * @return
     */
    List<OrderRefundDTO> getRefundList(String orderNumber);

    /**
     * 最近一次查询结束时间到当前时间的数据
     */
    Result<List<MyAirportExpressOrderDTO>> recentToNow(LocalDateTime recent, LocalDateTime now);

    /**
     * 最近一次查询结束时间到当前时间的订单DTO
     */
    List<AirportExpressOrderDTO> queryOrderDTOList(LocalDateTime start, LocalDateTime end);
}
